<SCRIPT type="text/javascript">
	var myAjax = createAjax();
	stockDisplay();

	function stockDisplay()
	{
		myAjax.open("GET", "/stock/StockPrice.xml", true);
		myAjax.onreadystatechange = receiveResponse;
		myAjax.send("");

		self.setTimeout("stockDisplay()", 5000);
	}

	function receiveResponse()
	{
		if(myAjax.readyState == 4 && myAjax.status == 200)
		{
			var stockList = myAjax.responseXML.documentElement;
			for(i=0; i<stockList.getElementsByTagName("STOCK").length; i++)
			{
				var seq = stockList.getElementsByTagName("STOCK")[i].getAttribute("seq");
				var pm = stockList.getElementsByTagName("STOCK")[i].getAttribute("pm");
				var name = stockList.getElementsByTagName("STOCK")[i].getElementsByTagName("NAME")[0].text;
				var price = stockList.getElementsByTagName("STOCK")[i].getElementsByTagName("PRICE")[0].text;

				var updateText = name + ":" + insertComma(price)

				var writeObj = eval("document.getElementById('stock"+i+"')");
				replaceText(writeObj, updateText);

				var imageObj = eval("document.getElementById('stockImg"+i+"')");
				eval("document.getElementById('stockImg"+i+"')").src = "/images/stock/"+pm+".jpg";
			}
		}
	}

</SCRIPT>

<TABLE width="1000" cellspacing="1" cellpadding="5" bgcolor="#7682EB" width="250">
<%
	int count = 0;
	for(int i=0; i<3; i++)
	{
%>
	<TR bgcolor="#FFFFFF">
<%
		for(int j=0; j<6; j++)
		{
%>
		<TD width="166">
			<B><SPAN id="stock<%= count%>"></SPAN></B><IMG id = "stockImg<%= count%>" src="/images/stock/0.jpg" width="13" height="13" align="absmiddle">
		</TD>
<%
			count++;
		}
%>
	</TR>
<%
	}
%>
</TABLE>